<template>
    <div class="pagination-box">
        <el-pagination
                @size-change="sizeChange"
                @current-change="currentChange"
                :current-page="pages.current"
                background
                :page-sizes="pages.sizes"
                :page-size="pages.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="pages.total"
        ></el-pagination>
    </div>
</template>

<script>
    export default {
        props: {
            pages: {}
        },
        methods: {
            sizeChange(page) {
                this.pages.size = page;
                this.$emit('sizeChange', page);
            },
            currentChange(page) {
                this.pages.current = page;
                this.$emit('currentChange', page);
            }
        }
    }
</script>